# -*- conding:UTF-8 -*-

'''
@ Project: one-group
@ File: send_code.py
@ Author: 孙博
@ Date：2022/6/8 18:51

'''
from ronglian_sms_sdk import SmsSDK
from common.celery_tasks.main import app

ACCID = "8aaf0708804ba563018064d2f5f60681"

AUTHTOKEN = "2a77bac658e5476abd5d58fbfe673ada"

APPID = "8aaf0708804ba563018064d2f6cd0688"


@app.task
def send_message(mobile, sms_code, expire=5):
    sdk = SmsSDK(ACCID, AUTHTOKEN, APPID)
    tid = '1'
    mobile = '%s' % mobile
    datas = ('%s' % sms_code, '%s' % expire)
    res = sdk.sendMessage(tid, mobile, datas)
    if res:
        return True
    return False
